<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ace="http://www.icefaces.org/icefaces/components"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets">

  <h:head>
  </h:head>
  <h:body>
    <ui:composition xmlns="http://www.w3.org/1999/xhtml"
                    xmlns:h="http://java.sun.com/jsf/html"
                    xmlns:f="http://java.sun.com/jsf/core"
                    xmlns:c="http://java.sun.com/jsp/jstl/core"
                    xmlns:ace="http://www.icefaces.org/icefaces/components"
                    xmlns:icecore="http://www.icefaces.org/icefaces/core"
                    xmlns:ui="http://java.sun.com/jsf/facelets"
                    template="layout.xhtml">
      <ui:define name="title">Main / Awesome Dates</ui:define>
      <ui:define name="leftNav" >
        <ui:include src="includes/leftNav.xhtml"/>
      </ui:define>
      <ui:define name="content">


        <ace:panel id="personalInfoInputPanel" header="Login info">

          <h:form id="textEntryForm" styleClass="btnRegisterLogin">
            <h:panelGrid id="inputGrid" columns="1" width="100%" styleClass="textEntryInputTable">
              <ace:textEntry   style="width:150px" id="usernameInput"  value="#{userManager.user.username}" label="Username" labelPosition="left" required="true" requiredMessage="Username is required" requiredIndicator="(*)" indicatorPosition="right" >

              </ace:textEntry>

              <ace:textEntry style="width:150px" id="passwordInput" binding="#{passwordField}" secret="true" value="#{userManager.user.password}" label="Password" labelPosition="left" requiredMessage="Password is required"  required="true" requiredIndicator="(*)" indicatorPosition="right">

              </ace:textEntry>
            </h:panelGrid>
            <h:panelGrid width="100%">
              <ace:messages globalOnly="true"/>
              <ace:message  for="usernameInput" styleClass="messageUsername" />
              <ace:message id="lastNameMsg" for="passwordInput"/>
            </h:panelGrid>
            <h:commandButton  value="Enter" action="#{userManager.login()}" style="margin-left:3px; display: inline;"/>
            <f:ajax execute="@this" event="click"/>
          </h:form>
          <h:form styleClass="btnRegisterLogin">
            <h:commandButton  value="Register" action="register" immediate="true" style="display:inline;"/>
          </h:form>
        </ace:panel>
      </ui:define>
    </ui:composition>
  </h:body>
</html>

